package com.lagou.pojo;

import javax.sql.DataSource;
import java.util.HashMap;
import java.util.Map;

public class Configuration {
    private DataSource dataSource;
    /*
     * 用来存储sql语句的id和对应的MapModel对象
     */
    Map<String, MappedStatement> mappedStatementMap = new HashMap<>();


    public Configuration() {
    }

    public Configuration(DataSource dataSource, Map<String, MappedStatement> mappedStatementMap) {
        this.dataSource = dataSource;
        this.mappedStatementMap = mappedStatementMap;
    }

    /**
     * 获取
     * @return dataSource
     */
    public DataSource getDataSource() {
        return dataSource;
    }

    /**
     * 设置
     * @param dataSource
     */
    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }

    /**
     * 获取
     * @return mappedStatementMap
     */
    public Map<String, MappedStatement> getMappedStatementMap() {
        return mappedStatementMap;
    }

    /**
     * 设置
     * @param mappedStatementMap
     */
    public void setMappedStatementMap(Map<String, MappedStatement> mappedStatementMap) {
        this.mappedStatementMap = mappedStatementMap;
    }

    public String toString() {
        return "Configuration{dataSource = " + dataSource + ", mappedStatementMap = " + mappedStatementMap + "}";
    }
}
